package com.example.spring.security.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : zhayh
 * @date : 2021-4-17 14:07
 * @description :
 */

@RestController
public class HelloController {
    @GetMapping("/")
    public String hello() {
        return "hello security";
    }

    // root和admin用户具有访问权限
    @GetMapping("/admin/hello")
    public String admin() {
        return "hello admin";
    }

    // admin和user用户具有访问权限
    @GetMapping("/user/hello")
    public String user() {
        return "hello user";
    }

    // root用户具有访问权限
    @GetMapping("/dba/hello")
    public String dba() {
        return "hello dba";
    }
}
